<div class="pagebar">
<#if totalRecord%pageSize==0>
    <#assign totalPage=totalRecord/pageSize>
<#else>
    <#assign totalPage=(totalRecord/pageSize)?int+1>
</#if>
<#if pageIndex gt 3>
    <#assign startIndex=pageIndex-3>
<#else>
    <#assign startIndex=1>
</#if>
<#if  pageIndex lt 4>
    <#assign endIndex=7>
<#elseif totalPage-pageIndex gt 3>
    <#assign endIndex=pageIndex+3>
<#else>
    <#assign endIndex=totalPage>
</#if>
<#if pageIndex gt 1>
    <a class="prev" href="${url?replace('[[pageIndex]]','${pageIndex-1}')}" title="上一页">上一页</a>
</#if>
<#list startIndex..endIndex as p>
    <#if p==pageIndex>
        <span class="current">${p}</span>
    <#else>
        <a href="${url?replace('[[pageIndex]]','${p}')}" title="第${p}页">${p}</a>
    </#if>
</#list>
<#if totalPage-pageIndex gt 3>
    <span class="dots">...</span>
</#if>
<#if totalPage gt pageIndex>
    <a class="next" href="${url?replace('[[pageIndex]]','${pageIndex+1}')}" title="下一页">下一页</a>
</#if>

</div>

